<script>
export default {
name: "WorkOrederWBXView",
data() {
  return {
    list: {},
    statusss:2
  }
},
created() {
  // 获取参数
  this.id = this.$route.query.id
  // 查询
  this.axios.get(`http://localhost:9999/api-work-order-service/work-order/findById?id=` + this.id).then(res => {
    this.list = res.data.data;
    console.log(res)
    console.log(this.list)
  })
},
methods: {
  onBack() {
    this.$router.go(-1);
  },
  change(val) {
    this.statusss=val
    console.log(val)
  }
}
}
</script>

<template>
  <div>
    <h3>只可查看，无法修改</h3>
    <div v-if="list.workOrderType==2">
      <h3>维保项</h3>
      <p class="patrol">空调主机 除尘养护</p>
      <van-radio-group v-model="list.workOrderHost" direction="horizontal">
        <van-radio :name="1">正常</van-radio>
        <van-radio :name="2">异常</van-radio>
      </van-radio-group>
      <p class="patrol">空调主机 冷凝管疏通</p>
      <van-radio-group v-model="list.workOrderHostTwo" direction="horizontal">
        <van-radio :name="1">正常</van-radio>
        <van-radio :name="2">异常</van-radio>
      </van-radio-group>
      <p class="patrol">空调通风管 通风管疏通</p>
      <van-radio-group v-model="list.workOrderTube" direction="horizontal">
        <van-radio :name="1">正常</van-radio>
        <van-radio :name="2">异常</van-radio>
      </van-radio-group>
    </div>


    <div v-if="list.workOrderType==3" class="patrol">
      <p class="patrol">空调开关</p>
      <van-radio-group v-model="list.workOrderPatrolOne" direction="horizontal">
        <van-radio :name="1">正常</van-radio>
        <van-radio :name="2">异常</van-radio>
      </van-radio-group>
      <p class="patrol">灯开关</p>
      <van-radio-group v-model="list.workOrderPatrolTwo" direction="horizontal">
        <van-radio :name="1">正常</van-radio>
        <van-radio :name="2">异常</van-radio>
      </van-radio-group>
      <p class="patrol">消防门</p>
      <van-radio-group v-model="list.workOrderPatrolThree" direction="horizontal">
        <van-radio :name="1">正常</van-radio>
        <van-radio :name="2">异常</van-radio>
      </van-radio-group>
      <p class="patrol">气体传感器</p>
      <van-radio-group v-model="list.workOrderPatrolFour" direction="horizontal" @change="change">
        <van-radio :name="1">正常</van-radio>
        <van-radio :name="2">异常</van-radio>
      </van-radio-group>
      <van-field v-if="statusss==2" v-model="list.workOrderPatrolFourOne" type="number" label="温度" />
    </div>
    <van-button type="primary" size="large" @click="onBack">返回</van-button>
  </div>
</template>

<style scoped>
.patrol {
  font-align: left;
  text-align: left;
}
</style>